import request from '@/utils/request'

export function listCreatePage(params) {
  return request({
    url: '/notice/listCreatePage',
    method: 'get',
    params
  })
}

export function listRecivePage(params) {
  return request({
    url: '/notice/listRecivePage',
    method: 'get',
    params
  })
}

export function unread() {
  return request({
    url: '/notice/unread',
    method: 'get',
  })
}

export function getById(id) {
  return request({
    url: `/notice/getById?id=${id}`,
    method: 'get',
  })
}

export function saveNotice(data) {
  return request({
    url: `/notice/add`,
    method: 'post',
    data
  })
}

export function updateNotice(data) {
  return request({
    url: `/notice/update`,
    method: 'post',
    data
  })
}

export function delNotice(id) {
  return request({
    url: `/notice/delete`,
    method: 'delete',
    params: { id: id }
  })
}
